package com.jinrustar.weimaqi.util

import com.jinrustar.weimaqi.app.Constant.API_KEY

/**
 * Created by liduanwei on 2017/10/26 0026. liduanwei1988@gmail.com
 */
object AppUtil {

    fun concatWithApiKey(paramsMap: Map<String, Any>): String {
        var str = ""
        str += concatWithoutKey(paramsMap)
        str += "key=" + API_KEY
        return str
    }

    fun concatWithoutKey(paramsMap: Map<String, Any>): String {
        val stringBuilder = StringBuilder()
        for (key in paramsMap.keys) {
            stringBuilder.append(key).append("=").append(paramsMap[key]).append("&")
        }
        return stringBuilder.toString()
    }
}